import http from "./request"

export function openTable(tableId){
	return http.post('ERPApi/Cashier/OpenTable',{
		tableId:tableId,
		peopleCount:2
	})
}

/**
 *
 * @description 获取分类列表
 * @returns
*/
export let GetCategories = () => {
    return http.get("ERPApi/Wx/GetCategories");
};

/**
 * @description 产品列表
 */
export let GetProductList = (params) => {
    return http.get("ERPApi/Wx/GetProductList", { params });
};

/**
 * @description 单一产品
 */
export let GetProductById = (params) => {
    return http.get("ERPApi/Wx/GetById", { params });
};
/**
 * @description 获取餐台信息
 */
export function GetCartByTableId(params){
    return http.get("ERPApi/Wx/GetCartByTableId", {params});
}

/**
 * @description 根据台号获取当前购物车信息
 */
export function GetDinnerTableInfo(params){
    return http.get("/ERPApi/Wx/GetDinnerTableInfo",{params})
}

/**
 * @description 添加购物车
 */
 export function AddCart(params){
    return http.post("/ERPApi/Wx/AddCart",params)
}

/**
 * @description 下单
 */
 export function AddOrder(params){
    return http.post("/ERPApi/Wx/AddOrder",params)
}

/**
 * @description 根据订单号获取订单详情
 */
 export function GetMemberOrderById(params){
    return http.get("/ERPApi/Wx/GetMemberOrderById",{params})
}

/**
 * @description 获取会员的订单列表
 */
 export function GetOrderByShopId(params){
    return http.get("/ERPApi/Wx/GetOrderByShopId",{params})
}
/**
 * @description 清空购物车
 */
 export function ClearCart(params){
    return http.get("/ERPApi/Wx/ClearCart",{params})
}


export function getPayArgs(params){
	return http.get('/ERPApi/Wx/PayOrder',{params})
}